<?php

namespace App\Http\Middleware;

use Closure;

class SystemMiddleware
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        $admin = \Auth::user();
        view()->share([
            'admin' => $admin,
            'systems' => config('fangshop.systems'),
            '_system'=>'lesson',
        ]);

        return $next($request);
    }


}
